﻿@using com.hyrentals.webcommon.extensions
@using com.hyrentals.webportal.Config
@using com.hyrentals.data

@{
    Html.AddStyle("css/rv");
    Html.AddTailScript("js/rv-create");
}

<div class="layout-primary">
   <div class="rv-create">
            <div class="title">
                <p>List Your RV</p>
                <p>Share the fun, reward yourself with money and friendship</p>
            </div>
            
            <form id="J_RVCreate" class="form-s1" action="" method="post">
            <ul class="valid-simple">
               @* RV Type *@
                <li class="clearfix">
                    <label for="rv_type" class="label">RV Type</label>
                    <select id="rv_type" class="select" name="type" data-msgbox="#msg_rv_type">
                    @{
                        foreach(RVTypeEnum type in Enum.GetValues(typeof(RVTypeEnum)))
                        {
                            byte index = (byte)type;
                            string name = NameMapping.RVTypeEnumNameArray[index];
                            if(type != RVTypeEnum.Other)
                            {
                                <option value="@index">@name</option>
                            }
                        }

                        byte RVTypeOtherIndex = (byte)RVTypeEnum.Other;
                        string RVTypeOtherName = NameMapping.RVTypeEnumNameArray[RVTypeOtherIndex];
                        <option value="@RVTypeOtherIndex">@RVTypeOtherName</option>
                    }
                    </select>
                    <span id="msg_rv_type" style="display: none;"></span>
                </li>

                @* Model & Style *@
                <li class="clearfix">
                    <label for="rv_model_style" class="label">Model & Style</label>
                    <input id="rv_model_style" class="input-text" type="text" name="modelstyle"  data-msgbox="#msg_model_style" autocomplete="off"/>
                    <span id="msg_model_style" style="display: none;"></span>
                </li>

                @* Year *@
                <li class="clearfix">
                    <label for="rv_made_year" class="label">Year</label>
                    <select id="rv_made_year" class="select" name="madeyear" data-msgbox="#msg_rv_made_year">
                    @{
                        DateTime now = DateTime.UtcNow;
                        int nowYear = now.Year;
                        for (int i = nowYear, endYear = nowYear - 50; i > endYear; --i)
                        {
                            <option value="@i">@i</option>
                        }
                    }
                    </select>
                    <span id="msg_rv_made_year" style="display: none;"></span>
                </li>

                @* Made *@
                <li class="clearfix">
                    <label for="rv_made_by" class="label">Made by</label>
                    <select id="rv_made_by" class="select" name="madeby" data-msgbox="#msg_rv_made_by">
                    @{
                        foreach (RVMadeByEnum type in Enum.GetValues(typeof(RVMadeByEnum)))
                        {
                            byte index = (byte)type;
                            string name = NameMapping.RVMadeByEnumNameArray[index];
                            if (type != RVMadeByEnum.Other)
                            {
                                <option value="@index">@name</option>
                            }
                        }
                        byte RVMadeByOtherIndex = (byte)RVMadeByEnum.Other;
                        string RVMadeByOtherName = NameMapping.RVTypeEnumNameArray[RVMadeByOtherIndex];
                        <option value="@RVMadeByOtherIndex">@RVMadeByOtherName</option>
                    }
                    </select>
                    <span id="msg_rv_made_by" style="display: none;"></span>
                    <div id="J_RVMadeWrap" class="made-wrap" style="display: none;">
                        <label for="rv_made" class="label" style="width: 50px; margin-left: 30px; padding-right: 0;">Make</label>
                        <input id="rv_made" class="input-text" type="text" name="made"  data-msgbox="#msg_made" autocomplete="off"/>
                    </div>
                </li>

                 @* Sleeps *@
                 <li class="clearfix">
                    <label for="rv_sleeps" class="label">Sleeps</label>
                    <select id="rv_sleeps" class="select" name="sleeps" data-msgbox="#msg_rv_sleeps">
                    @{
                        for (int i = 10; i > 0; --i)
                        {
                            <option value="@i">@i</option>
                        }
                    }
                    </select>
                    <span id="msg_rv_sleeps" style="display: none;"></span>
                 </li>

                  @* Length *@
                  <li class="clearfix">
                    <label for="rv_length" class="label">RV Length</label>
                    <input id="rv_length" class="input-text" type="text" name="length"  data-msgbox="#msg_rv_length" autocomplete="off"/><span class="unit">FT</span>
                    <span id="msg_rv_length" style="display: none;"></span>
                  </li>

                  @* Zip *@
                  <li class="clearfix">
                    <label for="rv_zip" class="label">Pickup Zip</label>
                    <input id="rv_zip" class="input-text" type="text" name="zip"  data-msgbox="#msg_rv_zip" autocomplete="off"/>
                    <span id="msg_rv_zip" style="display: none;"></span>
                  </li>

                  @* Availability *@
                  <li class="clearfix">
                    <label class="label">Availability</label>
                    @{
                        foreach (RVAvailabilityTypeEnum availabilityType in Enum.GetValues(typeof(RVAvailabilityTypeEnum)))
                        {
                            byte index = (byte)availabilityType;
                            string name = NameMapping.RVAvailabilityTypeEnumNameArray[index];
                            <span class="radio-wrap"><input id="rv_availability" class="radio" type="radio" name="availability" value="@index" data-msgbox="#msg_rv_availability"/>@name</span>
                        } 
                        
                    }
                    <span id="msg_rv_availability" style="display: none;"></span>

                  </li>

                  <li class="clearfix">
                    <label class="label" style="line-height: 16px; height: 16px;"></label>
                    <span class="agree">
                        <input id="rv_agree" class="chk" type="checkbox" name="agree" value="true" />
                        <input type="hidden" name="agree" value="false"/>
                        <label for="rv_agree">I wish HyRental to handle online booking for your (Leave it unchecked if you only want your list to show on Hyrental for free)</label>
                    </span>
                  </li>

                  <li class="clearfix">
                    <label class="label"></label>
                    <a id="J_CreateSubmit" href="javascript:;" class="btn btn-large">Continue</a>
                  </li>
            </ul>

        </form>
           
    </div>
</div>